﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  xmlns:VMDS_GUIClient_ViewModels="clr-namespace:VMDS.GUIClient.ViewModels" xmlns:Custom="http://schemas.AvalonControls/AvalonControlsLibrary/Controls" x:Class="VMDS.GUIClient.Views.StartModalDialog"
             x:Name="root"
             mc:Ignorable="d" 
             d:DesignHeight="456.375" d:DesignWidth="549" >
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="ResourceDictionary1.xaml"/>
			</ResourceDictionary.MergedDictionaries>
			<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
			<Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
				<Setter Property="Background"><Setter.Value><RadialGradientBrush><GradientStop Offset="0" Color="Black" /><GradientStop Offset="1" Color="Black" /></RadialGradientBrush></Setter.Value></Setter>
				<Setter Property="Height" Value="40" />
				<Setter Property="Foreground" Value="white" />
				<Setter Property="Grid.Row" Value="2" />
				<Setter Property="Grid.Column" Value="3" />
				<Setter Property="Content" Value="Forgot your password?" />
				<Setter Property="Margin" Value="3" />
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type Button}">
							<ControlTemplate.Resources>
								<Storyboard x:Key="Storyboard1">
									<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="GelBackground">
										<EasingColorKeyFrame KeyTime="0" Value="#FFB18C8C"/>
									</ColorAnimationUsingKeyFrames>
									<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="GelBackground">
										<EasingDoubleKeyFrame KeyTime="0" Value="0.55"/>
									</DoubleAnimationUsingKeyFrames>
								</Storyboard>
								<Storyboard x:Key="OnMouse">
									<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="grid">
										<EasingDoubleKeyFrame KeyTime="0" Value="1">
											<EasingDoubleKeyFrame.EasingFunction>
												<CircleEase EasingMode="EaseOut"/>
											</EasingDoubleKeyFrame.EasingFunction>
										</EasingDoubleKeyFrame>
										<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0.75">
											<EasingDoubleKeyFrame.EasingFunction>
												<CircleEase EasingMode="EaseOut"/>
											</EasingDoubleKeyFrame.EasingFunction>
										</EasingDoubleKeyFrame>
										<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1">
											<EasingDoubleKeyFrame.EasingFunction>
												<CircleEase EasingMode="EaseOut"/>
											</EasingDoubleKeyFrame.EasingFunction>
										</EasingDoubleKeyFrame>
									</DoubleAnimationUsingKeyFrames>
								</Storyboard>
							</ControlTemplate.Resources>
							<Grid x:Name="grid" d:DesignWidth="125" RenderTransformOrigin="0.5,0.5">
								<Grid.RenderTransform>
									<TransformGroup>
										<ScaleTransform/>
										<SkewTransform/>
										<RotateTransform/>
										<TranslateTransform/>
									</TransformGroup>
								</Grid.RenderTransform>
								<Grid.RowDefinitions>
									<RowDefinition Height="0.467*"/>
									<RowDefinition Height="0.216*"/>
									<RowDefinition Height="0.317*"/>
								</Grid.RowDefinitions>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="*"/>
								</Grid.ColumnDefinitions>
                
								<Rectangle x:Name="GelBackground" Opacity="1" RadiusX="9" RadiusY="9" StrokeThickness="0.35" Grid.ColumnSpan="1" Fill="#FF626060" Grid.RowSpan="3"><Rectangle.Stroke><LinearGradientBrush StartPoint="0,0" EndPoint="0,1"><GradientStop Offset="0" Color="White" /><GradientStop Offset="1" Color="#666666" /></LinearGradientBrush></Rectangle.Stroke></Rectangle>
								<Rectangle x:Name="GelShine" Margin="2,2,2,-3" VerticalAlignment="Stretch" RadiusX="6" RadiusY="6" Opacity="1" Stroke="Transparent" Height="Auto" Grid.ColumnSpan="1" d:LayoutOverrides="GridBox"><Rectangle.Fill><LinearGradientBrush StartPoint="0,0" EndPoint="0,1"><GradientStop Offset="0" Color="#ccffffff" /><GradientStop Offset="1" Color="Transparent" /></LinearGradientBrush></Rectangle.Fill></Rectangle>
								<ContentPresenter x:Name="GelButtonContent" VerticalAlignment="Center" HorizontalAlignment="Center" Content="{TemplateBinding Content}" Grid.ColumnSpan="1" Grid.Column="1" Grid.Row="0" d:LayoutOverrides="GridBox" Height="Auto" Margin="0" Grid.RowSpan="3" />
                
							</Grid>

							<ControlTemplate.Triggers>

								<Trigger Property="IsMouseOver" Value="true">
									<Trigger.EnterActions>
										<BeginStoryboard x:Name="OnMouse_BeginStoryboard" Storyboard="{StaticResource OnMouse}"/>
									</Trigger.EnterActions>
    						
									<Setter Property="Fill" TargetName="GelBackground"><Setter.Value><RadialGradientBrush><GradientStop Offset="0" Color="Lime" /><GradientStop Offset="1" Color="DarkGreen" /></RadialGradientBrush></Setter.Value></Setter>
								</Trigger>
								<Trigger Property="IsDefault" Value="true">
									<Setter TargetName="GelBackground" Property="Fill">
										<Setter.Value>
											<RadialGradientBrush>
												<GradientStop Offset="0.005" Color="#FF00DDFF" />
												<GradientStop Offset="1" Color="#FF1B0064" />
											</RadialGradientBrush>
										</Setter.Value>
									</Setter>
								</Trigger>
						
								<Trigger Property="IsEnabled" Value="False">
									<Trigger.ExitActions>
										<RemoveStoryboard BeginStoryboardName="Storyboard1_BeginStoryboard"/>
									</Trigger.ExitActions>
									<Trigger.EnterActions>
										<BeginStoryboard x:Name="Storyboard1_BeginStoryboard" Storyboard="{StaticResource Storyboard1}"/>
									</Trigger.EnterActions>
								</Trigger>
								<Trigger Property="IsPressed" Value="true">
									<Setter Property="Fill" TargetName="GelBackground"><Setter.Value><RadialGradientBrush><GradientStop Offset="0" Color="Lime" /><GradientStop Offset="1" Color="DarkGreen" /></RadialGradientBrush></Setter.Value></Setter>
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
				<Style.Triggers>
					<Trigger Property="IsMouseOver" Value="true">
						<Setter Property="Foreground" Value="black " />
					</Trigger>
					<Trigger Property="IsPressed" Value="true">
						<Setter Property="Foreground" Value="black " />
					</Trigger>
				</Style.Triggers>
			</Style>
		</ResourceDictionary>
	</UserControl.Resources>
	<UserControl.DataContext>
		<VMDS_GUIClient_ViewModels:StartDialogViewModel/>
	</UserControl.DataContext>
    <Grid Margin="0,1,0,-1" Visibility="{Binding Instance.Visible, Converter={StaticResource BooleanToVisibilityConverter}}">
        <Border Background="#76000000" Visibility="{Binding Visibility}">
        	            
            <Border BorderBrush="Black" BorderThickness="1" 
                        CornerRadius="20,0,20,0" VerticalAlignment="Center"
                       HorizontalAlignment="Center" Height="{Binding ActualHeight+200, ElementName=expander}" Width="340.36">
            	<Border.Background>
            		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            			<GradientStop Color="#C071AAAF" Offset="0.54"/>
            			<GradientStop Color="#E6FFFFFF" Offset="1"/>
            			<GradientStop Color="#DDE1E9E9" Offset="0.02"/>
            		</LinearGradientBrush>
            	</Border.Background>
                
               
                
            	<Grid Margin="10">
            		<Grid.RowDefinitions>
            			<RowDefinition Height="0.16*"/>
            			<RowDefinition Height="0.84*"/>
            		</Grid.RowDefinitions>
            		<Label Margin="8,0" FontSize="18.667" HorizontalAlignment="Center" Background="#00E95050" Foreground="#FF010102" FontWeight="Bold" Height="40" Content="{Binding Instance.VmName}" VerticalAlignment="Top"/>
            		<Button Margin="8,0,0,35" Style="{DynamicResource DisabledButton}" FontSize="16" Height="34.921" HorizontalContentAlignment="Left" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="86.784" Command="{Binding Instance.Start, Mode=OneWay}">
            			<StackPanel Margin="0">
            				<Image Source="Images/ok.png" Margin="0,-5,0,0" Width="28" Height="28"/>
            				<TextBlock TextWrapping="Wrap" Text="Запуск" FontSize="16" Margin="0,-11,0,0" />
            			</StackPanel>
            		</Button>
            		<Button Margin="0,0,8,0" Style="{DynamicResource DisabledButton}" FontSize="16" Height="69.921" HorizontalContentAlignment="Left" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="74.02" Command="{Binding Instance.Close, Mode=OneWay}">
            			<StackPanel Margin="0">
            				<Image Source="Images/cancel.png" Margin="0,2,0,0" Width="40"/>
            				<TextBlock TextWrapping="Wrap" Text="Отмена" FontSize="18.667" Margin="0,-11,0,0" />
            			</StackPanel>
            		</Button>
            		<Expander x:Name="expander" Header="Дополнительные параметры" Margin="8,0,8,91.054" Grid.Row="1" FontSize="16" IsExpanded="{Binding Instance.Expanded}">
            			<Grid>
            				<Grid.RowDefinitions>
            					<RowDefinition Height="150"></RowDefinition>     				
								<RowDefinition Height="*"></RowDefinition>     				
							</Grid.RowDefinitions>
            				<Grid Height="140">
            					<Rectangle Stroke="#FFF8F3F3" StrokeThickness="0.5" RadiusX="10" RadiusY="10" Height="138.135" VerticalAlignment="Top">
            						<Rectangle.Fill>
            							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.435">
            								<LinearGradientBrush.RelativeTransform>
            									<TransformGroup>
            										<ScaleTransform CenterY="0.5" CenterX="0.5"/>
            										<SkewTransform CenterY="0.5" CenterX="0.5"/>
            										<RotateTransform CenterY="0.5" CenterX="0.5"/>
            										<TranslateTransform/>
            									</TransformGroup>
            								</LinearGradientBrush.RelativeTransform>
            								<GradientStop Color="#FFEFECEC"/>
            								<GradientStop Offset="0.558"/>
            								<GradientStop Color="#FFEFECEC" Offset="1"/>
            								<GradientStop Offset="0.494"/>
            							</LinearGradientBrush>
            						</Rectangle.Fill>
            					</Rectangle>
            					<Button Grid.Column="0" Height="21" Margin="0,42.135,0,0" Grid.Row="0" Style="{DynamicResource GreenButton2}" VerticalAlignment="Top" Content="Максимум" FontSize="16" IsDefault="{Binding Instance.IsMaximum}" HorizontalAlignment="Center" Width="105" Command="{Binding Instance.DoMaximum, Mode=OneWay}" ToolTip="Выделить всю доступную память" FontFamily="Arial"/>
            					<Button Grid.Column="0" Height="21" Margin="0,63.135,0,0" Grid.Row="0" Style="{DynamicResource GreenButton2}" Content="Нормально" FontSize="16" IsDefault="{Binding Instance.IsMedium}" HorizontalAlignment="Center" Width="105" Command="{Binding Instance.DoMedium, Mode=OneWay}" ToolTip="Выделить рекомендованный размер памяти" FontFamily="Arial" VerticalAlignment="Top"/>
            					<Button Grid.Column="0" Height="21" Margin="0,84.135,0,0" Grid.Row="0" Style="{DynamicResource GreenButton2}" Content="Минимум" FontSize="16" VerticalAlignment="Top" IsDefault="{Binding Instance.IsMinimum}" HorizontalAlignment="Center" Width="105" Command="{Binding Instance.DoMinimum, Mode=OneWay}" ToolTip="Выделить минимально допустимый размер памяти" FontFamily="Arial"/>
            					<Label Content="Сколько выделить ресурсов?" Margin="21.851,8,23.851,0" FontSize="16" Background="#00E95050" Foreground="#FF111018" FontWeight="Bold" Height="30.135" VerticalAlignment="Top" d:LayoutOverrides="Width"/>
            					<Button Grid.Column="0" Height="21" Margin="0,105.135,0,0" Grid.Row="0" Style="{DynamicResource GreenButton2}" Content="Вручную" FontSize="16" VerticalAlignment="Top" IsDefault="{Binding Instance.IsCustom}" HorizontalAlignment="Center" Width="105" Command="{Binding Instance.DoCustom, Mode=OneWay}" ToolTip="Укажите произвольное значение ОЗУ для данной виртуальной машины" FontFamily="Arial"/>
            				</Grid>
            				<Grid x:Name="grid" VerticalAlignment="Bottom" Margin="0,0,0,-4" Grid.Row="1" Visibility="{Binding Instance.IsCustom, Converter={StaticResource BooleanToVisibilityConverter}}">
            					<Rectangle Stroke="#FFF8F3F3" StrokeThickness="0.5" RadiusX="10" RadiusY="10" Height="42.133" VerticalAlignment="Top">
            						<Rectangle.Fill>
            							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.435">
            								<LinearGradientBrush.RelativeTransform>
            									<TransformGroup>
            										<ScaleTransform CenterY="0.5" CenterX="0.5"/>
            										<SkewTransform CenterY="0.5" CenterX="0.5"/>
            										<RotateTransform CenterY="0.5" CenterX="0.5"/>
            										<TranslateTransform/>
            									</TransformGroup>
            								</LinearGradientBrush.RelativeTransform>
            								<GradientStop Color="#FFEFECEC"/>
            								<GradientStop Offset="0.558"/>
            								<GradientStop Color="#FFEFECEC" Offset="1"/>
            								<GradientStop Offset="0.494"/>
            							</LinearGradientBrush>
            						</Rectangle.Fill>
            					</Rectangle>
            					<Slider x:Name="slider" Margin="8,11.133,70,6" SmallChange="32" TickPlacement="TopLeft" TickFrequency="32" Minimum="64" Maximum="{Binding Instance.MaxRAM}" Value="{Binding Instance.CustomRAM, Mode=TwoWay}" LargeChange="32" IsSnapToTickEnabled="True" d:LayoutOverrides="Height"/>
            					<Label Content="{Binding Value, ElementName=slider}" HorizontalAlignment="Right" Margin="0,11.133,15,6" Width="48" FontSize="13.333"/>
            					<Label HorizontalAlignment="Right" Margin="0,11.133,4,6" Width="27.68" Content="МБ" FontSize="13.333"/>
            				</Grid>
            			</Grid>
            		</Expander>
            		<Button Height="31" Margin="8,0,0,0" Grid.Row="1" VerticalAlignment="Bottom" Style="{DynamicResource ButtonStyle1}" IsDefault="{Binding Instance.IsNeedToClose}" Command="{Binding Instance.NeedClose, Mode=OneWay}" Grid.Column="0" HorizontalAlignment="Left" Width="86.784">
            			<TextBlock TextWrapping="Wrap" Text="Закрыть СУВМ после запуска"/>
            		</Button>
            	</Grid>
                
            </Border>
            
        </Border>
        
    </Grid>

</UserControl>
